#include<stdio.h>
int main()
{
    int year1,month1,day1,year2,month2,day2,num=0;
    int day[13]={0,31,28,31,30,31,30,31,31,30,31,30,31};
    scanf("%d-%d-%d",&year1,&month1,&day1);
    scanf("%d-%d-%d",&year2,&month2,&day2);
    while(year1!=year2+1){
        day1=year1/1000+year1%1000/100*10;
        month1=year1%10*10+year1%100/10;
        if(month1>=1&&month1<=12){
            if(year1%4==0&&year1%100!=0||year1%400==0){
                day[2]=29;
                if(day1<=day[month1])
                    num++;
            }
            else
                if(day1<=day[month1])
                    num++;
        }
        year1++;
    }
    printf("%d\n",num);
    return 0;
}